﻿using System;
using System.Text.RegularExpressions;

namespace RealNumbersValidator
{
    class RealNumbersValidator
    {
        static bool CheckIsValid(string number)
        {
            string pattern =
                @"\A0\Z |                       # zero
                \A(-)?[1-9][0-9]*\Z |           # integers
                \A0\.[0-9]+\Z |                 # real numbers between 0 and 1
                \A-0\.[0-9]*[1-9]+[0-9]*\Z |    # real numbers between -1 and 0
                \A(-)?[1-9][0-9]*\.\d+\Z        # the rest real numbers";
            Regex regex = new Regex(pattern, RegexOptions.IgnorePatternWhitespace);
            bool isMatch = regex.IsMatch(number);
            return isMatch;
        }

        static void Main()
        {
        }
    }
}
